﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.DAL.DocumentCenter;

namespace MS.InformationManagement.Presenter.GestionPerfiles
{
    public class GestionPerfilesPresenter : BasePresenter<IGestionPerfilesView>
    {
        #region Constructors

        public GestionPerfilesPresenter(IGestionPerfilesView view) : base(view) { }
        
        #endregion

        #region Methods

        public void HandleLoad()
        {
            View.EntidadesPerfiles = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.GetPerfiles();
            View.listAllRoles = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.getAllRoles();
            
            View.Show();
        }

        public void RequestRolesPerfil()
        {
        //    View.ListRoleByPerfil = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.GetRolesByPerfil(View.Perfil);
        //    View.GetRolesPerfil();
        }

        public void Delete()
        {
            View.SuccedDelete = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.DeletePerfil(View.Perfil);
            View.EntidadesPerfiles = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.GetPerfiles();
            View.Show();
        }

        public void Save()
        {
            View.SuccedUpdate = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.UpdatePerfil(View.Perfil, View.newRolList);
        }

        public void Create()
        {
            View.SuccedCreate = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.CreatePerfil(View.Perfil);
            View.EntidadesPerfiles = MS.InformationManagement.BLL.GestionPerfiles.GestionPerfiles.GetPerfiles();
            View.Show();
        }


        #endregion


    }
}
